home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / Examples / AppKit / ToDo / SelectionNotifMatrix.m < prev    next >
Encoding:
Text File  |  1996-03-26  |  634 b   |  26 lines

  1. /* SelectionNotifMatrix.m created by tjdono on Fri 03-Nov-1995 */
  2.  
  3. #import "SelectionNotifMatrix.h"
  4.  
  5. NSString *SelectionInMatrixNotification = @"SelectionInMatrixNotification";
  6.    
  7. @implementation SelectionNotifMatrix
  8.  
  9. - (void)mouseDown:(NSEvent *)theEvent
  10. {
  11.     int row;
  12.     [super mouseDown:theEvent];
  13.     
  14.     row = [self selectedRow];
  15.     if (row != -1) {
  16.         [[NSNotificationCenter defaultCenter]
  17.  postNotificationName:SelectionInMatrixNotification
  18.                object:self
  19.              userInfo:[NSDictionary dictionaryWithObjectsAndKeys:
  20.                  [NSNumber numberWithInt:row], @"ItemIndex", nil]];
  21.     }
  22. }
  23.  
  24.  
  25. @end
  26.